import 'package:flutter/material.dart';

class loginButton extends StatelessWidget {
  //登录时的按钮参数
  final String text;
  final bool enable;
  //少一个参数
  VoidCallback? onPressed;

  loginButton(this.text, {super.key, this.onPressed, this.enable = false});

  @override
  Widget build(BuildContext context) {
    return MaterialButton(
      onPressed: enable ? onPressed : null,
      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
      height: 45,
      color: Colors.orange,
      disabledColor: Colors.grey,
      child: Text(text, style: TextStyle(fontSize: 16, color: Colors.white)),
    );
  }
}
